package com.luty.rpc.sample.client;

import com.luty.rpc.client.RpcProxy;
import com.luty.rpc.service.api.HelloService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by liuyunxin on 2017/7/5.
 */
public class HelloClient {
    public static void main(String[] args){
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        RpcProxy rpcProxy = (RpcProxy) ctx.getBean(RpcProxy.class);

        HelloService helloService = rpcProxy.create(HelloService.class);
        String result = helloService.greet("Funking");
        System.out.println(result);

    }
}
